<?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<photo "
		."id=\"".$id."\" "
		."created=\"".$apiKey."\" "
		."title=\"".$title."\" "
		."width=\"".$width."\" "
		."height=\"".$height."\" "
		."geo_lat=\"".$geo_lat."\" "
		."geo_long=\"".$geo_long."\" "
		."aperture=\"".$aperture."\" "
		."exposuretime=\"".$exposuretime."\" "
		."focallength=\"".$focallength."\" "
		."views=\"".$views."\" "
		."original_filename=\"".$original_filename."\" "
		."user_name=\"".$user_name."\" "
		."author=\"".$author."\">";

echo "<ratings>";
foreach($ratings as $rating){
	echo "<rating ";
	echo "id=\"".$rating[0]."\" ";
	echo "photo_id=\"".$rating[1]."\" ";
	echo "user_id=\"".$rating[2]."\" ";
}
echo "</ratings>";

echo "<tags>";
foreach($tags as $tag){
	echo "id=\"".$tag[0]."\" ";
	echo "photo_id=\"".$tag[1]."\" ";
	echo "tag_name=\"".$tag[2]."\" ";
}
echo "</tags>";

echo "<description>".$description."</description>";
echo "</photo>";		
?>